package com.zygh.lz.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zygh.lz.entity.duty.DutyModel;
import com.zygh.lz.entity.duty.DutyPost;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectKey;

/**
 * @author lee
 */
@Mapper
public interface DutyPostMapper extends BaseMapper<DutyPost> {
    @Insert(value = "<script>" +
            " INSERT INTO duty_post" +
            " (post_code,post_name,last_time) " +
            " VALUES (#{postCode},#{postName},#{lastTime}) " +
            " </script>")
    @SelectKey(statement="select LAST_INSERT_ID()",keyProperty = "id",before = false,resultType = Integer.class)
    Integer insertId(DutyModel dutyModel);
}
